﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Gencode.PrsWeb.App;

namespace Gencode.PrsWeb.Modules
{
    public partial class MainMenu : System.Web.UI.UserControl
    {
		//GeneralIndex indexe = null;

        protected void Page_Load(object sender, EventArgs e)
        {
			User info = Session["USERRIGHTS"] as User;
			//indexe = Session["USERINDEX"] as GeneralIndex;
			//if (indexe == null)
			//    indexe = GeneralIndex.CreateInstance();

			if (info == null)
			{
				FileMenu.Style.Add("visibility", "hidden");
			}
        }

		protected void FileMenu_MenuItemClick(object sender, MenuEventArgs e)
		{
			switch (e.Item.Value)
			{
				case "Logout":
					Session["USERRIGHTS"] = null;
					Session["USERINDEX"] = null;
					Response.Redirect("Login.aspx");
					break;
				case "Plan":
					Response.Redirect("Personalplaner.aspx");
					break;
				case "Personuebersicht":
					Response.Redirect("Personuebersicht.aspx");
					break;
				case "Personalstamm":
					Response.Redirect("Personalstamm.aspx");
					break;
				default:
					break;
			}
		}
    }
}